<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta content="HTML Tidy for Cygwin (vers 1st February 2003), see www.w3.org" name="generator">
    <meta name="keywords" content="electronic commerce, ecommerce, ebusiness, e-business, e-commerce, enterprise software, net economy, Netscape, Sun Microsystems, DevEdge Archive, iPlanet, internet software">
    <meta name="description" content="The DevEdge Archive, a strategic alliance formed by America Online and Sun Microsystems, Inc., is delivering iPlanet e-commerce software and enterprise solutions that enable companies to compete successfully in the Net Economy">
    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
    <meta name="TEMPLATEBASE" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher 2000. manual wdt 1.5">
    <meta name="LASTUPDATED" content="09/28/00 13:16:27">
    <title>
      Core JavaScript Reference 1.5:
    </title>
    <link rel="stylesheet" type="text/css" href="js15ref.css">
  </head>
  <body>
    <table width="100%" border="0" cellspacing="4">
      <tr>
        <td valign="top">
          <b><a class="sansserifPurple" href="classint.html">Previous</a></b>&nbsp;&nbsp;&nbsp;&nbsp; <a href="contents.html"><b class="sansserifPurple">Contents</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="ix.html"><b class="sansserifPurple">Index</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="lcjsobj.html"><b class="sansserifPurple">Next</b></a> &nbsp;&nbsp;&nbsp;&nbsp;
        </td>
      </tr>
      <tr>
        <td class="sansserifBlack" valign="top" align="right" bgcolor="#CCCCCC">
          <b>Core JavaScript Reference 1.5</b>
        </td>
      </tr>
    </table><br>
     
    <blockquote>
      <br>
      <br>
      <br>
      <br>
       
      <p>
        <a name="1193143" id="1193143"></a> <a name="JSException" id="JSException"></a> <span class="sansserif"><b>JSException</b></span>
      </p>
      <p>
        <a name="1193144" id="1193144"></a> <span class="sansserif">The public class <span class="mono">JSException</span> extends <span class="mono">RuntimeException</span>.</span>
      </p>
      <p>
        <a name="1194126" id="1194126"></a> <span class="mono">java.lang.Object<br>
         &nbsp;&nbsp;&nbsp;|<br>
         &nbsp;&nbsp;&nbsp;+----java.lang.Throwable<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----java.lang.Exception<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----java.lang.RuntimeException<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+----netscape.javascript.JSException</span>
      </p>
      <p>
        <br>
         <a name="1194181" id="1194181"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194182" id="1194182"></a> <span class="sansserif"><span class="mono">JSException</span> is an exception which is thrown when JavaScript code returns an error.</span>
      </p>
      <p>
        <br>
         <a name="1193147" id="1193147"></a> <a name="Constructor Summary" id="Constructor Summary"></a> <span class="sansserif"><b>Constructor Summary</b></span><br>
         <a name="1193148" id="1193148"></a> <span class="sansserif">The <span class="mono">netscape.javascript.JSException</span> class has the following constructors:</span>
      </p>
      <p>
        <a name="1193544" id="1193544"></a> <span class="sansserif"><br></span>
      </p><br>
       
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr bgcolor="#CCCCCC" align="left" valign="top">
          <th valign="top" align="left">
            <a name="1193151" id="1193151"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Constructor</b></span>
            </p>
          </th>
          <th valign="top" align="left">
            <a name="1193153" id="1193153"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Description</b></span>
            </p>
          </th>
        </tr>
        <tr>
          <td valign="top">
            <a name="1193158" id="1193158"></a> <span class="mono"><b><a href="lcjsexc.html#1193164">JSException</a></b></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194401" id="1194401"></a> <span class="sansserif">Deprecated constructors optionally let you specify a detail message and other information.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
         <a name="1193826" id="1193826"></a> <a name="Method Summary" id="Method Summary"></a> <span class="sansserif"><b>Method Summary</b></span><br>
         <a name="1194741" id="1194741"></a> <span class="sansserif">The <span class="mono">netscape.javascript.JSException</span> class has the following methods:</span>
      </p>
      <p>
        <a name="1194758" id="1194758"></a> <span class="sansserif"><br></span>
      </p><br>
       
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr bgcolor="#CCCCCC" align="left" valign="top">
          <th valign="top" align="left">
            <a name="1194744" id="1194744"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Method</b></span>
            </p>
          </th>
          <th valign="top" align="left">
            <a name="1194746" id="1194746"></a> 
            <p class="alignleft">
              <span class="sansserif"><b>Description</b></span>
            </p>
          </th>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194751" id="1194751"></a> <span class="mono"><a href="lcjsexc.html#1193796">getWrappedException</a></span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194753" id="1194753"></a> <span class="sansserif">Instance method getWrappedException.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194755" id="1194755"></a> <span class="mono">getWrappedExceptionType</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194757" id="1194757"></a> <span class="sansserif">Instance method getWrappedExceptionType returns the int mapping of the type of the wrappedException object.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <a name="1194110" id="1194110"></a> <span class="sansserif">The following sections show the declaration and usage of the constructors and method.</span>
      </p>
      <p>
        <br>
         <a name="1193956" id="1193956"></a> <a name="Backward Compatibility" id="Backward Compatibility"></a> <span class="sansserif"><b>Backward Compatibility</b></span>
      </p>
      <p>
        <a name="1194250" id="1194250"></a> <span class="sansserif"><b>JavaScript 1.1 through 1.3.</b></span> <a name="1194278" id="1194278"></a> <span class="sansserif"><span class="mono">JSException</span> had three public constructors which optionally took a string argument, specifying the detail message or other information for the exception. The <span class="mono">getWrappedException</span> method was not available.</span>
      </p>
      <p>
        <a name="1193164" id="1193164"></a> <a name="JSException" id="JSException"></a> <span class="sansserif"><b>JSException</b></span>
      </p>
      <p>
        <a name="1193165" id="1193165"></a> <span class="sansserif">Constructors, deprecated in JavaScript 1.4. Constructs a <span class="mono">JSException</span> with an optional detail message.</span>
      </p>
      <p>
        <br>
         <a name="1193166" id="1193166"></a> <a name="Declaration" id="Declaration"></a> <span class="sansserif"><b>Declaration</b></span><br>
         <a name="1194438" id="1194438"></a><span class="mono">1. public JSException()</span>
      </p>
      <p>
        <a name="1194422" id="1194422"></a><span class="mono">2. public JSException(String s)</span>
      </p>
      <p>
        <a name="1194423" id="1194423"></a><span class="mono">3. public JSException(String s,<br>
         &nbsp;&nbsp;&nbsp;String filename,<br>
         &nbsp;&nbsp;&nbsp;int lineno,<br>
         &nbsp;&nbsp;&nbsp;String source,<br>
         &nbsp;&nbsp;&nbsp;int tokenIndex)</span>
      </p>
      <p>
        <br>
         <a name="1193170" id="1193170"></a> <a name="Arguments" id="Arguments"></a> <span class="sansserif"><b>Arguments</b></span><br>
         <a name="1193192" id="1193192"></a> <span class="sansserif"><br></span>
      </p><br>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <a name="1194467" id="1194467"></a> <span class="mono">s</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194469" id="1194469"></a> <span class="sansserif">The detail message.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194463" id="1194463"></a> <span class="mono">filename</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194465" id="1194465"></a> <span class="sansserif">The URL of the file where the error occurred, if possible.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194459" id="1194459"></a> <span class="mono">lineno</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194461" id="1194461"></a> <span class="sansserif">The line number if the file, if possible.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194455" id="1194455"></a> <span class="mono">source</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194457" id="1194457"></a> <span class="sansserif">The string containing the JavaScript code being evaluated.</span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <a name="1194451" id="1194451"></a> <span class="mono">tokenIndex</span> 
            <p>
              &nbsp;
            </p>
          </td>
          <td valign="top">
            <p>
              <a name="1194453" id="1194453"></a> <span class="sansserif">The index into the source string where the error occurred.</span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
      <p>
        <br>
      </p>
      <p>
        <a name="1193796" id="1193796"></a> <a name="getWrappedException" id="getWrappedException"></a> <span class="sansserif"><b>getWrappedException</b></span>
      </p>
      <p>
        <a name="1193797" id="1193797"></a> <span class="sansserif">Instance method <span class="mono">getWrappedException</span>.</span>
      </p>
      <p>
        <br>
         <a name="1193798" id="1193798"></a> <a name="Declaration" id="Declaration"></a> <span class="sansserif"><b>Declaration</b></span><br>
         <a name="1193799" id="1193799"></a> <span class="mono">public Object getWrappedException()</span>
      </p>
      <p>
        <br>
         <a name="1194770" id="1194770"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194771" id="1194771"></a> <span class="sansserif"><span class="mono">getWrappedException()</span> returns an object that represents the value that the JavaScript actually threw. JavaScript can throw any type of value. Use <span class="mono">getWrappedException()</span> to determine what kind of value the Object return type represents.</span>
      </p>
      <p>
        <br>
      </p>
      <p>
        <a name="1194668" id="1194668"></a> <a name="getWrappedExceptionType" id="getWrappedExceptionType"></a> <span class="sansserif"><b>getWrappedExceptionType</b></span>
      </p>
      <p>
        <a name="1194669" id="1194669"></a> <span class="sansserif">Instance method <span class="mono">getWrappedExceptionType</span>.</span>
      </p>
      <p>
        <br>
         <a name="1194670" id="1194670"></a> <a name="Declaration" id="Declaration"></a> <span class="sansserif"><b>Declaration</b></span><br>
         <a name="1194671" id="1194671"></a> <span class="mono">public int getWrappedExceptionType()</span>
      </p>
      <p>
        <br>
         <a name="1194798" id="1194798"></a> <a name="Description" id="Description"></a> <span class="sansserif"><b>Description</b></span><br>
         <a name="1194875" id="1194875"></a> <span class="sansserif"><span class="mono">getWrappedExceptionType()</span> returns an <span class="mono">int</span> that matches one of the following static <span class="mono">int</span>s declared by the <span class="mono">JSException</span> class:</span>
      </p>
      <p>
        <a name="1194964" id="1194964"></a> <span class="sansserif"><br></span>
      </p>
      <p>
        <br>
        <br>
      </p>
      <table width="90%" border="1" cellpadding="5" cellspacing="0">
        <tr>
          <td valign="top">
            <p>
              <a name="1194922" id="1194922"></a> <span class="sansserif"><span class="mono">EXCEPTION_TYPE_EMPTY</span></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194924" id="1194924"></a> <span class="sansserif"><span class="mono">EXCEPTION_TYPE_VOID</span></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194926" id="1194926"></a> <span class="sansserif"><span class="mono">EXCEPTION_TYPE_OBJECT</span></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194928" id="1194928"></a> <span class="sansserif"><span class="mono">EXCEPTION_TYPE_FUNCTION</span></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194930" id="1194930"></a> <span class="sansserif"><span class="mono">EXCEPTION_TYPE_STRING</span></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194932" id="1194932"></a> <span class="sansserif"><span class="mono">EXCEPTION_TYPE_NUMBER</span></span> &nbsp;
            </p>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <p>
              <a name="1194934" id="1194934"></a> <span class="sansserif"><span class="mono">EXCEPTION_TYPE_BOOLEAN</span></span> &nbsp;
            </p>
          </td>
        </tr>
      </table>
    </blockquote>
    <blockquote>
      <br>
       <b><a class="sansserifPurple" href="classint.html">Previous</a></b>&nbsp;&nbsp;&nbsp;&nbsp; <a href="contents.html"><b class="sansserifPurple">Contents</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="ix.html"><b class="sansserifPurple">Index</b></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="lcjsobj.html"><b class="sansserifPurple">Next</b></a> &nbsp;&nbsp;&nbsp;&nbsp; 
      <hr noshade="noshade" size="1">
      <span class="sansserif">Copyright &copy; 2000 <a href="http://www.netscape.com">Netscape Communications Corp.</a> All rights reserved.</span>
    </blockquote>
    <p class="alignright">
      <span class="sansserif">Last Updated <b>September 28, 2000</b></span>
    </p>
  </body>
</html>
